var fs=require("fs");
var path=require("path");


var filePath1=path.join(__dirname,"/from.txt");
var readable1=fs.createReadStream(filePath1);
readable1.on("data",function(chunk){
    
    var filePath2=path.join(__dirname,"/to.txt");
    var writable2=fs.createWriteStream(filePath2);
    writable2.write(chunk.toString("utf-8").toUpperCase());
    writable2.end();
    console.log(chunk.toString("utf-8").toUpperCase());
});
readable1.on("end",function(){
    console.log("readable ended");
})
//readable1.pipe(process.stdout);
